package org.mags.rema.model.provider;

// Generated Dec 6, 2009 5:47:57 PM by Hibernate Tools 3.2.2.GA
// powered by BTS-GT

import java.io.Serializable; 

import org.mags.dao.provider.AbstractCacheableDataProvider;
import org.mags.rema.model.entity.EntityStructure;
import org.mags.rema.model.entity.EntityStructureId;

public class EntityStructureProvider extends AbstractCacheableDataProvider<EntityStructure> {
	private static final long serialVersionUID = 1L;
	public EntityStructure getById(int entityTypeId, int entityTypeParentId) {
		for(EntityStructure i: getAll()) {
			if(entityTypeId == i.getId().getEntityTypeId() 
			  && entityTypeParentId == i.getId().getEntityTypeParentId())
				return i;
		}	
		return null;
	}
	public EntityStructure getById(Serializable id) {
		for(EntityStructure i : getAll()) {
			if(i.getId().getEntityTypeId()==((EntityStructureId)id).getEntityTypeId() &&
			   i.getId().getEntityTypeParentId()==((EntityStructureId)id).getEntityTypeParentId())
				return i;
		}
		return null;
	}
	protected void loadProperties(EntityStructure[] all) {		
	}	
}
